// 四舍五入, 保留指定位数
export function round(num, retain_len) {
	retain_len = retain_len === undefined ? 2 : retain_len
	return Math.round(Math.pow(10, retain_len) * num) / Math.pow(10, retain_len)
}


export function GetParamsVal(url, name) {
	console.log(url)
	var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
	console.log(reg.test(url))
	if (reg.test(url)) return unescape(RegExp.$2.replace(/\+/g, " "));
	return "";
}